#include<stdio.h>

int getFac(int n)
{
  int fac = 0;
  for(int i = 1; i <= n; i++)
  {
    int tmp = 1;
    for(int j = 1; j <= i; j++)
    {
      tmp *= j; //计算阶乘值
    }
    fac += tmp; //阶乘和
  }

  return fac;
}

int main()
{
  //计算阶乘
  char* str = "开始运算";
  printf("%s\n", str);
  int fac = getFac(5);
  printf("%d\n", fac);
  return 0;
}
